As of Xcode 15.0.1, this is still happening.
Interesting, I have found that if you show a NavigationStack in your first view, push some contents into it, and then you push Switch to another element in your Sidebar, it won't crash, but your pushed views will stay there, covering the other selection's content. You can pop back and it won't crash.
struct SidebarEntryPointView: View {
@Binding var appNavigation: AppNavigation
var body: some View {
NavigationSplitView(columnVisibility: $appNavigation.navigationStyleColumnVisibility) {
List(selection: $appNavigation.rootView) {
NavigationLink(value: appNavigation.rootView) {
Label {
Text("Anime")
} icon: {
Image(systemName: "tv")
}
}
.tag(RootView.animeList)
NavigationLink(value: appNavigation.rootView) {
Label {
Text("Manga")
} icon: {
Image(systemName: "book")
}
}
.tag(RootView.mangaList)
}
} detail: {
switch appNavigation.rootView {
case .animeList:
NavigationStack(path: $appNavigation.animeListNavigationPath) {
Button("Click Me") {
appNavigation.animeListNavigationPath.append(NavigationElement.character(characterId: 34))
appNavigation.animeListNavigationPath.append(NavigationElement.staff(staffId: 33))
print(appNavigation.animeListNavigationPath)
//$firstTabNavigation.navigationPath += [.character(characterId: 23)]
//$firstTabNavigation.navigationPath.append(.staff(staffId: 23))
}
.navigationDestination(for: NavigationElement.self) { screen in
switch screen {
case .character(let characterId):
DummyCharacterView(id: characterId)
case.staff(let staffId):
DummyStaffView(id: staffId)
default:
Text("wat")
}
}
}
default: Text("No hay")
}
}
}
}
In this example, I have two sidebar elements, Anime and Manga. The app launches in the Anime selected state, and it has a button that pushes two views into the NavigationStack. If you push the button and then Switch the selection to Manga, it works (though you need to pop back to see the "no hay" view).
So this is probably caused by the NavigationStack somehow? Still something I hope to see addressed in Xcode 15.1.